package com.chii.gateway.admin.client;


import com.chii.gateway.admin.client.impl.GatewayClientFallback;

import com.chii.gateway.admin.po.GatewayRouteForm;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(value = "gateway-web", fallback = GatewayClientFallback.class)
public interface GatewayClient {

    @RequestMapping(value = "/actuator/gateway/routes/{route_id}", method = RequestMethod.POST, headers = {"content-type=application/json"})
    void add(@PathVariable("route_id") String route_id,@RequestBody String json);

    @RequestMapping(value = "/actuator/gateway/routes", method = RequestMethod.GET)
    List<GatewayRouteForm> get();

    @RequestMapping(value = "/actuator/gateway/routes/{route_id}", method = RequestMethod.POST)
    void del(@PathVariable("route_id") String route_id);

    @RequestMapping(value = "/actuator/gateway/refresh", method = RequestMethod.POST)
    void refresh();
}